def select_sort(old_list):
    new_list = []
    temp_list = old_list
    for i in range (len(old_list)):
        max_index = get_maxindex(test_list)
        new_list.append(temp_list[max_index])
        temp_list.pop(max_index)
    return new_list

def get_maxindex(list):
    """
    找出数组最大下标
    :param list:
    :return:
    """
    max = list[0]
    max_index = 0
    for i in range(len(list)):
        if(list[i]>max):
            max = list[i]
            max_index = i
    return max_index

if __name__ == '__main__':
    test_list = [5,3,6,2,10]
    print(select_sort(test_list))
